<template>
	<view :style="colorStyle">
		<view class='commission-details'>
			<view class='promoterHeader bg-color'>
				<view class='headerCon acea-row row-between-wrapper'>
					<view>
						<view class="acea-row" style="align-items: center;">
							<view>总获取津贴</view>
							<view class='money'>￥{{proxy.total_price|| 0}}</view>
						</view>

					</view>
					<view class='iconfont icon-jinbi1'></view>
				</view>
			</view>

			<view class='sign-record' v-if="orderStatus==0">
				<block v-for="(item,index) in recordList" :key="index" v-if="recordList.length > 0">
					<view class='list'>
						<view class='item'>
							<view class='listn'>
								<view class='itemn acea-row row-between-wrapper'>
									<view>
										<view class='name line1'>{{item.remark}}</view>
										<view>{{item.add_date}}</view>
									</view>
                  <view class='num font-color' >{{item.price}}</view>
								</view>
							</view>
						</view>
					</view>
				</block>
				<view v-if="recordList.length == 0">
					<emptyPage title='暂无记录~'></emptyPage>
				</view>

				<view class="loadingicon acea-row row-center-wrapper">
					<!-- <text class="loading iconfont icon-jiazai" :hidden="loading == false"></text> -->
					我也是有底线的~~~
				</view>
			</view>

		</view>

		<home></home>
	</view>
</template>

<script>
	import {
    getPriceList,
		// getStocksRecord
	} from '@/api/proxy.js';
	import {
		mapGetters
	} from "vuex";

	import emptyPage from '@/components/emptyPage.vue'
	import home from '@/components/home';
	import colors from '@/mixins/color.js';
	// #ifdef MP
	import authorize from '@/components/Authorize';
	// #endif
	export default {
		components: {
			// #ifdef MP
			authorize,
			// #endif
			emptyPage,
			home
		},
		mixins: [colors],
		data() {
			return {
				orderStatus: 0,
				recordList: [],
				dividend: [],
				userInfo: {},
				pageRecord: 1,
				limitRecord: 10,
				pageDividend: 1,
				limitDividend: 10,
        proxy:{},
			};
		},
		onShow: function() {
      this.ProxyPriceList(this.pageDividend, this.limitDividend)
		},
		methods: {
			getUserInfo: function() {
				let that = this;
				getUserInfo().then(res => {
					console.log(res)
					that.userInfo = res.data
				});
			},
			/**
			 * 分红记录
			 */
      ProxyPriceList(page, limit) {
				console.log(page, 'page,page,page,')
        getPriceList({
					page,
					limit
				}).then(res => {
					if (res.data.count > 0) {
						let list = res.data.list || [];
						// this.recordList = this.$util.SplitArray(list, this.recordList);
						this.recordList = list;
						this.proxy = res.data.proxy
						this.$set(this, 'recordList', this.recordList);
						this.pageRecord = this.pageRecord + 1
					}
				})
			},
		},
		onReachBottom: function() {
			this.ProxyPriceList();
		}
	}
</script>

<style scoped lang="scss">
	.sign-record {
		margin-top: 20rpx;
	}

	.commission-details .promoterHeader .headerCon .money {
		font-size: 36rpx;
	}

	.commission-details .promoterHeader .headerCon .money .num {
		font-family: 'Guildford Pro';
	}

	.nav {
		background-color: #fff;
		width: 690rpx;
		border-radius: 6rpx;
		margin: -30rpx auto 0 auto;
	}


	.nav .item {
		text-align: center;
		font-size: 26rpx;
		color: #282828;
		padding: 27rpx 0;
		border-bottom: 5rpx solid transparent;
	}

	.nav .item.on {
		/* #ifdef H5 || MP */
		font-weight: bold;
		/* #endif */
		/* #ifdef APP-PLUS */
		color: #000;
		/* #endif */
		border-color: var(--view-theme);
	}

	.nav .item .num {
		margin-top: 18rpx;
	}
</style>
